package com.authine.cloudpivot.ext.enums.personal;

/**
 * @Author: xuwei
 * @Date: Created in 2018/1/12
 */
public enum MessageTypeEnum {

    ALL(0, "全部消息"),
    EVENT(1, "系统事件"),
    NOTICE(2, "平台通知"),
    WORDS(3, "留言消息"),
    CLARIFY(4, "澄清消息"),
    INQUIRY(5,"询价事件"),
    ORDER(6,"订单事件"),
    FINANCE(7,"财务事件"),
    HOMEPOP(8, "首页弹窗");


    public Integer id;
    public String text;

    MessageTypeEnum(Integer id, String text) {

        this.id = id;
        this.text = text;
    }

    public static MessageTypeEnum get(Integer code) {

        if (code == null) {
            return null;
        }
        for (MessageTypeEnum c : MessageTypeEnum.values()) {
            if (c.id.toString().equals(code.toString())) {
                return c;
            }
        }
        return null;
    }


}
